{include file="Include/H_ui_head" /}
<title>知识库文章查看</title>
<base target = "_self">
<meta http-equiv="UserContent-Type" content="text/html; charset=utf-8" />
</head>
<body>
<article class="page-container">
    <form action="#" method="POST" enctype="multipart/form-data" class="form form-horizontal" id="submit">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>文章：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {php}
                $path=APP_PATH.'../uploads/worker/'.$rs['knowledge_base'];

                define('UTF32_BIG_ENDIAN_BOM', chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF));
                define('UTF32_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00));
                define('UTF16_BIG_ENDIAN_BOM', chr(0xFE) . chr(0xFF));
                define('UTF16_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE));
                define('UTF8_BOM', chr(0xEF) . chr(0xBB) . chr(0xBF));

                $text = file_get_contents($path);
                $first2 = substr($text, 0, 2);
                $first3 = substr($text, 0, 3);
                $first4 = substr($text, 0, 3);
                $encodType = "";
                if ($first3 == UTF8_BOM)
                $encodType = 'UTF-8 BOM';
                else if ($first4 == UTF32_BIG_ENDIAN_BOM)
                $encodType = 'UTF-32BE';
                else if ($first4 == UTF32_LITTLE_ENDIAN_BOM)
                $encodType = 'UTF-32LE';
                else if ($first2 == UTF16_BIG_ENDIAN_BOM)
                $encodType = 'UTF-16BE';
                else if ($first2 == UTF16_LITTLE_ENDIAN_BOM)
                $encodType = 'UTF-16LE';

                $content = file_get_contents($path);
                $content = iconv($encodType, "utf-8", $content);
                echo "<pre>";
                print_r($content);
                echo "</pre>";
                {/php}
            </div>
        </div>
        <!--$cbody = file($content);-->
        <!--for($i=0;$i<count($cbody);$i++){-->
        <!--echo $cbody[$i];echo "<br/>";-->
        <!--}-->
    </form>
</article>
{include file="include/H_ui_foot" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/messages_zh.js"></script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
